//
//  GYZHot_countryTableViewCell.m
//  Qyer
//
//  Created by GYz on 15/10/19.
//  Copyright © 2015年 GF. All rights reserved.
//

#import "GYZHot_countryTableViewCell.h"
#import "BaseHeader.h"
@implementation GYZHot_countryTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.itemSize = CGSizeMake(SCREEN_WIDTH / 7 * 3.1, SCREEN_WIDTH / 7 * 4.4);
        flowLayout.sectionInset = UIEdgeInsetsMake(SCREEN_WIDTH / 35, SCREEN_WIDTH / 25, SCREEN_WIDTH / 35, SCREEN_WIDTH / 25);
        [flowLayout setMinimumInteritemSpacing:10];
        [flowLayout setMinimumLineSpacing:10];
        
        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
        _collectionView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_collectionView];
        [_collectionView registerClass:[GYZHot_countryCollectionViewCell class] forCellWithReuseIdentifier:@"hotCountry"];        
    }
    return self;
}

- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
{
    [self.collectionView setDataSource:dataSource];
}
- (void)setDelegate:(id<UICollectionViewDelegate>)delegate
{
    [self.collectionView setDelegate:delegate];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
